﻿using mediaControl.ViewModels;
using mediaControl.Vo;
using Prism.Events;
using Prism.Services.Dialogs;
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Interop;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;
using System.Windows.Threading;

namespace mediaControl.Views
{
    /// <summary>
    /// Screen.xaml 的交互逻辑
    /// </summary>
    public partial class Screen : Window
    {
        public Screen()
        {
            InitializeComponent();
            
           
        }

        private void Window_IsEnabledChanged(object sender, DependencyPropertyChangedEventArgs e)
        {
            if (!IsEnabled) {
                this.Close();
            }

        }

        private void videoPlayer_MediaOpened(object sender, RoutedEventArgs e)
        {
            imagePlayer.Visibility = Visibility.Hidden;
            web.Visibility = Visibility.Hidden;
            if (null != web.Children && web.Children.Count > 0) {
                web.Children.RemoveAt(web.Children.Count - 1);
            }
            imagePlayer.Source = null;
            imagePlayerNext.Visibility = Visibility.Hidden;
            imagePlayerNext.Source = null;
            mainpImage.Content = null;
            mainpImage.Visibility = Visibility.Hidden;
            
        }
    }
}
